package com.sinosoft.dsp.component.bpm.viewbean.activity.part;

import java.util.ArrayList;
import java.util.List;

import com.sinosoft.dsp.component.bpm.service.core.BpmSelectItemsService;
import com.sinosoft.dsp.component.bpm.viewbean.activity.BpmAbstractActivityPartEditViewBean;
import com.sinosoft.dsp.component.bpm.viewbean.activity.IBpmActivityPartEditViewBean;

public class BpmActivityAwokesViewBean extends
		BpmAbstractActivityPartEditViewBean implements
		IBpmActivityPartEditViewBean {
	// 活动持续时间
	public static final String FIELD_AWOKE_DUEDATE = "duedate";

	private List<Awoke> awokes = new ArrayList<Awoke>();

	private Awoke[] selectedRows;

	public List<Awoke> getAwokes() {
		return awokes;
	}

	public void setAwokes(List<Awoke> awokes) {
		this.awokes = awokes;
	}

	public void addAwokes() {
		this.awokes.add(new Awoke());
	}

	public void removeAwokes() {
		if (selectedRows != null && selectedRows.length > 0) {
			for (Awoke a : selectedRows) {
				awokes.remove(a);
			}
		}
	}

	public Awoke[] getSelectedRows() {
		return selectedRows;
	}

	public void setSelectedRows(Awoke[] selectedRows) {
		this.selectedRows = selectedRows;
	}

	/**
	 * 提醒属性对象
	 * 
	 * @author 潘巍（PeterPan）
	 * @since 2011-8-10 上午11:34:24
	 * 
	 */
	public class Awoke {
		// 提醒时间类型
		private String type = BpmSelectItemsService.SELECT_ITEM_AWOKE_DEFAULT;

		// 重复时间
		private String value;

		// 重复次数
		private int repeatNum;

		// 是否消息提示
		private boolean isJms;

		// 是否短信提示
		private boolean isSms;

		// 提示内容
		private String tip;

		public String getType() {
			return type;
		}

		public void setType(String type) {
			this.type = type;
		}

		public String getValue() {
			return value;
		}

		public void setValue(String value) {
			this.value = value;
		}

		public int getRepeatNum() {
			return repeatNum;
		}

		public void setRepeatNum(int repeatNum) {
			this.repeatNum = repeatNum;
		}

		public boolean isJms() {
			return isJms;
		}

		public void setJms(boolean isJms) {
			this.isJms = isJms;
		}

		public boolean isSms() {
			return isSms;
		}

		public void setSms(boolean isSms) {
			this.isSms = isSms;
		}

		public String getTip() {
			return tip;
		}

		public void setTip(String tip) {
			this.tip = tip;
		}

	}
}
